<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>智能E生</title>
    <!-- Bootstrap 5 CSS -->
    <link href="../vandor/bootstrap-5.3.7-dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome 图标库 -->
    <link rel="stylesheet" href="../vandor/font-awesome/css/all.min.css">
    <link rel="stylesheet" href="../css/index.css">
</head>
<body>
<!-- 顶部标题栏 -->
<div class="header text-center">
    <div class="container">
        <div class="header-title">智能E生</div>
        <div class="header-subtitle">智能辅助问诊</div>
    </div>
</div>

<div class="container">
    <!-- 九宫格部分 -->
    <div class="section-container">
        <div class="section-title">核心功能</div>
        <div class="grid-container">
            <div class="row g-3">
                <!-- 第一行 -->
                <div class="col-4">
                    <div class="grid-item">
                        <div class="grid-icon"><i class="fas fa-archive"></i></div>
                        <div class="grid-title">智能药箱</div>
                        <div class="grid-desc">管理家庭药品</div>
                    </div>
                </div>
                <div class="col-4">
                    <div class="grid-item">
                        <div class="grid-icon"><i class="fas fa-user"></i></div>
                        <div class="grid-title">个人中心</div>
                        <div class="grid-desc">管理账户</div>
                    </div>
                </div>
                <div class="col-4">
                    <div class="grid-item">
                        <div class="grid-icon"><i class="fas fa-bell"></i></div>
                        <div class="grid-title">外诊解读</div>
                        <div class="grid-desc">查看外诊解读</div>
                    </div>
                </div>

                <!-- 第二行 -->
                <div class="col-4">
                    <div class="grid-item">
                        <div class="grid-icon"><i class="fas fa-receipt"></i></div>
                        <div class="grid-title">结果解读</div>
                        <div class="grid-desc">诊断结果解读</div>
                    </div>
                </div>
                <div class="col-4">
                    <div class="grid-item">
                        <div class="grid-icon"><i class="fas fa-stethoscope"></i></div>
                        <div class="grid-title">疾病自诊</div>
                        <div class="grid-desc">疾病诊断</div>
                    </div>
                </div>
                <div class="col-4">
                    <div class="grid-item">
                        <div class="grid-icon"><i class="fas fa-user-nurse"></i></div>
                        <div class="grid-title">名医问诊</div>
                        <div class="grid-desc">连线名医</div>
                    </div>
                </div>

                <!-- 第三行 -->
                <div class="col-4">
                    <div class="grid-item">
                        <div class="grid-icon"><i class="fas fa-phone-volume"></i></div>
                        <div class="grid-title">一键呼叫</div>
                        <div class="grid-desc">呼叫医生</div>
                    </div>
                </div>
                <div class="col-4">
                    <div class="grid-item">
                        <div class="grid-icon"><i class="fas fa-book-medical"></i></div>
                        <div class="grid-title">病历管理</div>
                        <div class="grid-desc">个人病历管理</div>
                    </div>
                </div>
                <div class="col-4">
                    <div class="grid-item">
                        <div class="grid-icon"><i class="fas fa-procedures"></i></div>
                        <div class="grid-title">健康管理</div>
                        <div class="grid-desc">个人健康管理</div>
                    </div>
                </div>
            </div>
        </div>

        <!-- 文章列表部分 -->
        <div class="section-title">热门文章</div>
        <div class="article-list">
            <div class="article-item">
                <div class="article-title">智能诊疗，让健康关怀触手可及！ <span class="badge-new">新</span></div>
                <div class="article-meta">
                    <span><i class="far fa-user"></i> 棍子老师</span>
                    <span><i class="far fa-clock"></i> 2025-06-12</span>
                    <span><i class="far fa-eye"></i> 50浏览</span>
                    <span><i class="far fa-comment"></i> 14评论</span>
                </div>
            </div>

            <!--<div class="article-item">
                <div class="article-title">致每一位关心健康的您</div>
                <div class="article-meta">
                    <span><i class="far fa-user"></i> 棍子老师</span>
                    <span><i class="far fa-clock"></i> 2025-06-09</span>
                    <span><i class="far fa-eye"></i> 4浏览</span>
                    <span><i class="far fa-comment"></i> 1评论</span>
                </div>
            </div>-->

        </div>
    </div>
</div>

<div class="footer">
    © 2025 智能E生 · 版权所有
</div>

<!-- Bootstrap 5 JS Bundle with Popper -->
<script src="../vandor/bootstrap-5.3.7-dist/js/bootstrap.bundle.min.js"></script>

<script>

    var storage = window.localStorage;



    // 添加点击事件
    document.querySelectorAll('.grid-item').forEach(item => {
        item.addEventListener('click', function() {
            const title = this.querySelector('.grid-title').textContent;
            // 实际项目中这里应该是导航到对应页面
            console.log(`导航到: ${title}`);

            // 添加点击反馈效果
            this.style.transform = 'translateY(-2px) scale(0.98)';

            var userModel = storage.getItem("userModel");
            if(userModel){
                var userData = JSON.parse(userModel);
                if(userData){

                }else{
                    alert("请登录系统")
                    window.location.href = "login.html";
                    return;
                }
            }else{
                alert("请登录系统")
                window.location.href = "login.html";
                return;
            }

            if(title == "疾病自诊"){
                window.location.href = "aiasking.html";
            }

            if(title == "个人中心"){
                window.location.href = "usercenter.html";
            }

            if(title == "病历管理"){
                window.location.href = "medicalrecord.html";
            }
            this.style.transform = '';

        });
    });

    document.querySelectorAll('.article-item').forEach(item => {
        item.addEventListener('click', function() {
            const title = this.querySelector('.article-title').textContent;
            // 实际项目中这里应该是打开文章详情
            console.log(`打开文章: ${title}`);

            window.location.href = "reading.html";

            // 添加点击反馈效果
            this.style.backgroundColor = 'rgba(67, 97, 238, 0.05)';
            setTimeout(() => {
                this.style.backgroundColor = '';
            }, 300);
        });
    });
</script>
</body>
</html>